<template>
  <view class="rules">
    <view class="content">
      <view class="hole-card">
        <!-- <slot></slot> -->

        <view class="cover-up">
          <view class="hole-up"> </view>
        </view>
        <view class="rules-center">
          <view class="rules-title">答题规则</view>
          <view class="rules-text"
            ><rich-text :nodes="data.content"></rich-text></view
          >

          <view class="rules-btn" @tap="toAnswer">立即参加</view>
        </view>
        <view class="cover-down">
          <view class="hole-down"></view>
        </view>

        <!-- <view class="cover-up">
          <view class="hole-up"> DEMO </view>
        </view> -->
      </view>
    </view>
  </view>
</template>

<script>
import "./index.scss";
import Taro, { getCurrentInstance } from "@tarojs/taro";
import consumerCard from "../../../components/consumerCard/index";
import img1 from "../../../assets/image/build1.png";
import consumerbg from "../../../assets/image/consumer-bg.png";
import requset from '../../../utils/request';

export default {
  components: {},
  data() {
    return {
      // consumerbg:consumerbg,
      detailId:'',
      list: [{ image: img1 }, { image: img1 }, { image: img1 }],
      data:{content:''},
    };
  },
    created() {
    console.log(getCurrentInstance().router.params.id, "2342");
    const detailId = getCurrentInstance().router.params.id;
    this.detailId =detailId
    this.getRlueDetail(detailId);
  },
  methods: {
    getRlueDetail(id){
        requset('get',`/api/rest/activity_batch/${id}.htm`).then((res)=>{
          console.log(res,'getRlueDetail')
          this.data = res
        })
    },
    toAnswer() {
      console.log("this.detailId", this.detailId);
      Taro.navigateTo({ url: `/pages/consumer/answer/index?id=${this.detailId}` });
    },
  },
};
</script>

<style>
</style>